<?php

/**
 * Albireo Kernel
 *
 * @copyright  Copyright (c) 2010 Albireo Solutions
 * @package    Kernel
 */
 
namespace KernelModule\LogsModule;

use Nette\Object;
use Nette\Environment;
use Nette\IO\SafeStream;

use Albireo\FileSystem\File;
use Albireo\FileSystem\Folder;

use KernelModule\LogsModule\LogsException;

/**
 * Kernel PHP Error searcher
 *
 * @author Pavel
 */
class Delete extends Object {

    public function deleteLogDirectoryContents() {
        $dirname = Environment::expand('%logDir%');

        $dir = new Folder($dirname);
        $files = $dir->getContent();
        foreach ($files as $filename) {
            $file = new File($dirname . DIRECTORY_SEPARATOR . $filename);
            $file->delete();
        }

        //throw new LogsException("No html page found.");
                //this happens whether there is no file corresponding the pattern
    }

}